const app = getApp()
//#endregion
// 
const {
  business,
  businesscollect
} = require('../../utils/api')
Page({
  data:{
    value:'',
    id:'',
    data:{},
    imgs:[]
  },
  onLoad: function (options) {
        this.setData({
          id: options.id,
      })
      business({
        id: options.id
    }).then(res => {
          this.setData({
            data:res,
            id: options.id,
            imgs:res.store_img.split(',')
        })
    })
  },

  scollect(event){
    businesscollect({
      memberId: this.data.id,
      area:100101
  }).then(res => {
    // console.log(res,'res')
      this.setData({
        data:res,
        imgs:res.store_img.split(',')
    })
    })
  },
  tel:function (event) {
    wx.makePhoneCall({
      phoneNumber: this.data.data.store_tel,
    })
  },
  previewimg(options){
    let {currentTarget} = options.currentTarget.dataset
    wx.previewImage({
      current: currentTarget,
      urls: this.data.imgs
  })
  }
})
